package com.xyzwps.ewa.modules.auth.session

import io.ktor.util.collections.*

class InMemorySessionStorage<S> : SessionStorage<S> {

    private val sessions = ConcurrentMap<String, S>()
    override fun invalidate(id: String) {
        sessions.remove(id)
    }

    override fun set(id: String, session: S) {
        sessions[id] = session
    }

    override fun get(id: String): S? {
        return sessions[id]
    }
}